This will output the result as int or float values (depending on output
format), separated by space.
It would allow to use the output of this script for testing conversion
(with expected output), and can also be used for chaining calls, making
this a re-entrant CLI tool.
- Add a --help/-h option.
- Detect invalid options (argument starting with '-').
- Support '--' option to indicate end of options. This can be
particularly useful to set negative component values in floating point
formats.
- Print usage in various error types (when they are of wrong
syntax/option types), additionally to printing it when --help is
called.
Fix alignment of vector of floats in babl-rgb-converter.c
Downstream Bug (Gentoo): https://bugs.gentoo.org/857708
Bug: https://gitlab.gnome.org/GNOME/babl/-/issues/76
Thanks-to: Alexander Bezrukov <phmagic@mail.ru> Signed-off-by: Alexander Bezrukov <phmagic@mail.ru> Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
- Add missing lcms dependencies. That's needed when lcms is a subproject
otherwise those targets does not find its headers.
- Add lcms2 wrap so meson can build it as subproject in case the
dependency is not found on system.
- Fix couple meson warnings
- Use meson.override_dependency() so babl can be used as subproject
without hardcoding "babl_dep" variable name in main project.
Eli Schwartz [Mon, 14 Mar 2022 00:26:05 +0000 (20:26 -0400)]
meson: fix misspelled kwarg name
set10 doesn't have a `Description` kwarg, it does have a `description`
kwarg though.
This caused the conf variable to not have a description when it should
have one, and newer versions of Meson with better argument validation
error out with:
Øyvind Kolås [Wed, 23 Feb 2022 16:34:59 +0000 (17:34 +0100)]
ci: disable to save the environment
Arch linux continue to be a bit incompatible with the buildfarm,
CI is already bad for the environment, cpu consuming expected
failures are even worse.
The CI might turn up again backed by debian, but it is better to
turn it off for now.
Andrzej Hunt [Sat, 4 Sep 2021 11:43:29 +0000 (13:43 +0200)]
babl_format_new: also free doc to plug leak
doc and name are allocated via babl_strdup, hence if we don't use them
we need to free both of them - therefore add a free(doc) to match the
existing free(name).
format_new (called just below) transfers ownership of doc, hence it's
correct not to free doc in the case where we're instantiating a new
format - whereas name is copied within format_new, and therefore needs to be
free'd in either scenario.
Leak seen while running gimp+babl built with ASAN:
Direct leak of 99 byte(s) in 1 object(s) allocated from:
#0 0x5e87cd in malloc /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
#1 0x7f038605e2b8 in babl_malloc /home/ahunt/git/babl/_build/../babl/babl-memory.c:115:9
#2 0x7f038605eec7 in babl_strdup /home/ahunt/git/babl/_build/../babl/babl-memory.c:296:9
#3 0x7f038605110f in babl_format_new /home/ahunt/git/babl/_build/../babl/babl-format.c:376:17
#4 0x7f037313a432 in init /home/ahunt/git/babl/_build/../extensions/cairo.c:569:25
#5 0x7f03860412a1 in babl_extension_load /home/ahunt/git/babl/_build/../babl/babl-extension.c:226:7
#6 0x7f0386040d1c in babl_extension_load_dir /home/ahunt/git/babl/_build/../babl/babl-extension.c:268:19
#7 0x7f03860409a8 in babl_extension_load_dir_list /home/ahunt/git/babl/_build/../babl/babl-extension.c:338:17
#8 0x7f038607d6cd in babl_init /home/ahunt/git/babl/_build/../babl/babl.c:154:7
#9 0x7f0386bce5ab in gegl_post_parse_hook /home/ahunt/git/gegl/_build/../gegl/gegl-init.c:542:3
#10 0x7f03844aad8a in g_option_context_parse /home/ahunt/git/glib/_build/../glib/goption.c:2228:12
#11 0x7f0386bce381 in gegl_init /home/ahunt/git/gegl/_build/../gegl/gegl-init.c:189:8
#12 0xef1f6b in gimp_init_for_testing /home/ahunt/git/gimp/app/tests.c:69:3
[...]
SUMMARY: AddressSanitizer: 99 byte(s) leaked in 1 allocation(s).
Øyvind Kolås [Wed, 9 Feb 2022 19:03:46 +0000 (20:03 +0100)]
babl: fix mutex lock/unlocks symmetry in babl_fish()
In the case where the fish we are to look up is the memcpy fish we were
not locking the mutex. Whereas the common cleanup after the branches
assumes the lock is held. This is probably the cause of gimp#7632.
Jehan [Mon, 24 Jan 2022 14:11:34 +0000 (15:11 +0100)]
tools: use rand() as fallback of random().
This fixes building babl on Windows as the random() API is not available
there (unlike rand()). Windows docs says it's not cryptographically
secure but for this tool usage, it's probably enough and I see we use
the same function replacement tricks on other tool sources.